<tagLib name="html" />
<include file="Public:header" />
<!--autocomplete-->
<script src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<css href="__PUBLIC__/Css/ui-base/jquery.ui.all.css" />
<script src="__PUBLIC__/Js/jquery-ui-1.8.11.custom.min.js"></script>
<!--
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
-->
<div id="main" class="main" >
<script language="JavaScript">
<!--
jQuery(document).ready(function(){
   /* $('#totalprice').click(
    function (){
        var amount = $(':checkbox[name:room_id]:checked').length;
        var house_id = $('#house_id').val();
        var start_time = $("input[name='start_time']").val();
        var end_time = $("input[name='end_time']").val();
        $('#room_num').attr('value', amount);
        jQuery.post(URL+'/calPrice',
        {house_id:house_id,
         amount:amount,
         start_time:start_time,
         end_time:end_time
        },
        function(msg){
            $('#totalprice').attr('value',msg);
        },
        'text')
    }
    );*/

    $( "#birds" ).autocomplete({
			source: URL+"/getAllMember",
			minLength: 1,
			select: function( event, ui ) {
				//log( ui.item ?"Selected: " + ui.item.value + " aka " + ui.item.id :"Nothing selected, input was " + this.value );
                                $('#member_id').attr('value',ui.item.id);
                    }
		});
    
});


//-->
</script>

<div class="content">
<form method='post' id="form1" action="__URL__/insert/" >
<div class="title">新增预订单 [ <input type="submit" value="新 增" class="small submit"> <a href="__URL__">返回订单列表</a>    <a href="__APP__/Housestats">返回房态</a>]</div>
<table cellpadding=3 cellspacing=3>
<tr>
	<td class="tRight" ><span class="red">*</span>预订人：</td>
        <td class="tLeft" >
            <input class="huge" id="birds" />填写两个以上的字符即可出现自动提示
            <input type="hidden" id="member_id" name="member_id" />
        </td>
</tr>
<tr>
	<td class="tRight" >预订房间：</td>
	<td class="tLeft" >
            <notempty name="_GET.room_id">
                {$_GET.room_id|getModelName='Room','house_id'|getModelName='House'}  <input type="checkbox" name="room_id[]"  value="{$_GET.room_id}" checked="checked">{$_GET.room_id|getModelName='Room','room_no'}
                <input type="hidden" name="house_id" id="house_id" value="{$_GET.room_id|getModelName='Room','house_id'}">
                <else />
                    <select name="hotel" style="width:200px;" onchange="modifyHouse(this);">
                        <option value="0">--请选择公寓--</option>
                        <volist name="hotel" id="ht">
                            <option value="{$ht.id}">{$ht.name}</option>
                        </volist>
                    </select>
                    {$vo.house_id|makeHouse}  {$vo.room_id|makeRoom}
            </notempty>
        </td>
</tr>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<tr>
	<td class="tRight" ><span class="red">*</span>入住：</td>
	<td class="tLeft" ><input type="text"  onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="start_time"  value="<notempty name='_GET.start_time'>{$_GET.start_time} 00:00:00</notempty>">
             &nbsp;&nbsp;<span class="red">*</span>离开：
            <input type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="end_time" id="end_time" value="">
        </td>
</tr>
<tr>
	<td class="tRight" ><span class="red">*</span>房间数：</td>
	<td class="tLeft" >
            <input type="text" name="room_num" id="room_num">
        </td>
</tr>
<tr>
	<td class="tRight" >总金额：</td>
	<td class="tLeft" >
            <input type="hidden" name="room_num" id="room_num">
            <input type="text" class="medium bLeft" id="totalprice" name="totalprice" >
        </td>
</tr>
<tr>
	<td class="tRight" >入住人数：</td>
	<td class="tLeft" >
            <input type="text" class="medium bLeft" name="person_num" value=""></td>
</tr>
<tr>
	<td class="tRight" >入住人姓名：</td>
	<td class="tLeft" ><input type="text" class="huge bLeft" name="cust_name" value=""></td>
</tr>
<tr>
	<td class="tRight" >入住人电话：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="cust_phone" value=""></td>
</tr>
<tr>
	<td class="tRight" >定金：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="advance_pay" value=""></td>
</tr>
<tr>
	<td class="tRight" >留言：</td>
        <td class="tLeft" ><textarea cols="57" rows="7" name="comment" ></textarea></td>
</tr>
<tr>
	<td class="tRight" >支付方式：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="paymethod_id" value=""></td>
</tr>

<tr>
	<td class="tRight tTop">备注说明：</td>
	<td class="tLeft"><textarea class="large bLeft"  name="remark" rows="5" cols="57"></textarea></td>
</tr>
<tr>
	<td class="tRight">订单状态：</td>
	<td class="tLeft">
            <select class="middle bLeft"  name="status">
                <volist name="orderStatus" id="os">
                    <option value="{$key}" <eq name="key" value="2">selected</eq> >{$os}</option>
                </volist>
            </select>
        </td>
</tr>
<tr>
	<td></td>
	<td class="center">
	<input type="submit" value="保 存" class="small submit">
	<input type="reset" class="reset imgButton" onclick="javascript:history.back()" value="返回" >
	</td>
</tr>
</table>
</form>
</div>
</div>
